/*
 * @author java_deng
 * @date 2025/4/5 15:52
 * @description
 */
package org.hbwl.controller;

import org.hbwl.dto.Comment;
import org.hbwl.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/comment")
public class CommentController extends BaseController{
    @Autowired
    private CommentService commentService;

    @PostMapping("/save")
    public Object save(@RequestBody Comment comment){
        commentService.save(comment);
        return success("发布成功");
    }

    @PostMapping("/list")
    public Object list(@RequestBody Comment comment){
        List<Comment> commentVoList= commentService.list(comment);
        return success(commentVoList);
    }

}
